package login.dao;


import login.model.LoginModel;

import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;


public class LoginDao {
	
	private MongoTemplate mongoTemplate;
	public MongoTemplate getMongoTemplate() {
		return mongoTemplate;
	}

	public void setMongoTemplate(MongoTemplate mongoTemplate) {
		this.mongoTemplate = mongoTemplate;
	}
	
	public LoginModel loginUser() {
		
		Criteria criteria = new Criteria();
		Query query = new Query(criteria);
		//criteria.and(key)
		return (LoginModel)
					mongoTemplate.findOne(query, LoginModel.class);
	}
}
